An image-reading device detects a position of an edge of a document in read data obtained by which an image sensor reads the document being conveyed by an automatic document feeder (“ADF”). For example, while moving a detection line from one side to the other side along a main-scanning direction, the image-reading device repeatedly detects, on the detection line extending along a sub-scanning direction (a document conveying direction), a candidate edge point having a pixel value that is different from a pixel value of pixels surrounding the candidate edge point by a threshold value or greater. Then, the image-reading device obtains an approximate straight line based on the detected candidate edge points and identifies the position of the edge of the document.